package com.bite.configdemo.controller;

import com.bite.configdemo.model.Student;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class YmlController {

    @Value("${user.uname}")
    private String userName;

    @Value("${myTest.str1}")
    private String str1;

    @Value("${myTest.str2}")
    private String str2;

    @Value("${myTest.str3}")
    private String str3;

    @Autowired
    private Student student;

    @PostConstruct
    public void getUserName() {
        System.out.println("====================");
//        System.out.println(userName);
//
//        System.out.println("默认的：" + "hi, yml\n where are you from?");
//        System.out.println("str1: " + str1);
//        System.out.println("str2: " + str2);
//        System.out.println("str3: " + str3);
        System.out.println(student);

    }
}
